package com.classload.service;

import com.classload.domain.Product;
import com.classload.service.fallback.ProductServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

// 原有的ribbon 改造为feign Product product = restTemplate.getForObject("http://service-product/product/" + pid, Product.class);
@FeignClient(value = "service-product",fallback = ProductServiceFallBack.class)
public interface ProductService {
    @RequestMapping("/product/{pid}")
    Product findByPid(@PathVariable("pid") Integer pid);
}
